package com.tank.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tank.bean.item.Image;
import com.tank.dao.ImageDao;
import com.tank.service.ImageService;

@Service("imageService")
public class ImageServiceImpl implements ImageService{
	@Autowired
	private ImageDao imageDao;
	public void addIamge(Image image){
		try{
			imageDao.addIamge(image);
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
	public List<Image> imageForPreview(String itemTag) {
		try{
			return imageDao.imageForPreview(itemTag);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	public void deleteTagImage(Integer imageid) throws Exception{
		imageDao.deleteTagImage(imageid);
	}
	public List<Image> queryImagesById(long productId) {
		try{
			return imageDao.queryImagesById(productId);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
